FROM php:7.4-fpm

# 安装 Composer
RUN apt-get update && apt-get install -y \
    unzip zlib1g-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev libzip-dev git libxml2-dev \
    && docker-php-ext-install bcmath pdo_mysql zip soap\
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install -j$(nproc) gd \
    && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
    && composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
    && pecl install xdebug-3.1.5 \
    && docker-php-ext-enable xdebug \
    && apt-get clean && rm -rf /var/lib/apt/lists/*


WORKDIR /var/php/www

CMD ["php-fpm", "-F"]
